<?php

namespace common\model;

use think\model\RelationModel;
use think\module\Module;
use teamones\dbeventObserver\SplSubjectEnforcer;
use teamones\dbeventObserver\interfaces\SplSubject;

class WorkTimeRecordModel extends RelationModel
{
    const TYPE_STANDARD_TASK = 'standard_task'; // 标准任务
    const TYPE_WORK_ORDER = 'work_order'; // 工单
    const TYPE_TO_DO = 'to_do'; //代办
    const TYPE_ASSET_REVIEW = 'asset_review'; // 资产审核
    const TYPE_SHOT_REVIEW = 'shot_review'; // 镜头审核
    const TYPE_WORK_ORDER_TO_DO = 'work_order_to_do'; // 工单待办
    const TYPE_WORK_ORDER_ASSET = 'asset'; // 资产制作
    const TYPE_WORK_ORDER_SHOT = 'shot'; // 镜头制作

    //非标准任务
    const TYPE_NOT_STANDARD_TASK = [
        WorkTimeRecordModel::TYPE_WORK_ORDER,
        WorkTimeRecordModel::TYPE_TO_DO
    ];

    //自动验证
    protected $_validate = [
        ['tenant_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['link_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['module_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
    ];

    //自动完成
    protected $_auto = [
        ['created', 'time', self::MODEL_INSERT, 'function'],
        ['updated', 'time', self::MODEL_INSERT, 'function']
    ];
}
